package com.analysis.dto;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
import java.util.Map;

/**
 * 腾讯云智能体开发平台对话端接口响应DTO
 * 基于腾讯云文档：https://cloud.tencent.com/document/product/1759/105561
 */
public class TencentChatResponse {
    
    /**
     * 事件类型
     */
    private String type;
    
    /**
     * 消息ID
     */
    @JsonProperty("message_id")
    private String messageId;
    
    /**
     * 事件载荷
     */
    private Payload payload;
    
    /**
     * 错误信息（仅错误事件时使用）
     */
    private Error error;
    
    /**
     * 事件载荷内部类
     */
    public static class Payload {
        /**
         * 消息内容
         */
        private String content;
        
        /**
         * 发送者头像
         */
        @JsonProperty("from_avatar")
        private String fromAvatar;
        
        /**
         * 发送者名称
         */
        @JsonProperty("from_name")
        private String fromName;
        
        /**
         * 是否为恶意内容
         */
        @JsonProperty("is_evil")
        private Boolean isEvil;
        
        /**
         * 是否为最终回复
         */
        @JsonProperty("is_final")
        private Boolean isFinal;
        
        /**
         * 是否来自自己
         */
        @JsonProperty("is_from_self")
        private Boolean isFromSelf;
        
        /**
         * 是否为LLM生成
         */
        @JsonProperty("is_llm_generated")
        private Boolean isLlmGenerated;
        
        /**
         * 知识库信息
         */
        private List<Knowledge> knowledge;
        
        /**
         * 消息记录ID
         */
        @JsonProperty("record_id")
        private String recordId;
        
        /**
         * 关联消息记录ID
         */
        @JsonProperty("related_record_id")
        private String relatedRecordId;
        
        /**
         * 回复方式
         */
        @JsonProperty("reply_method")
        private Integer replyMethod;
        
        /**
         * 请求ID
         */
        @JsonProperty("request_id")
        private String requestId;
        
        /**
         * 会话ID
         */
        @JsonProperty("session_id")
        private String sessionId;
        
        /**
         * 时间戳
         */
        private Long timestamp;
        
        /**
         * 链路ID
         */
        @JsonProperty("trace_id")
        private String traceId;
        
        /**
         * 是否可以反馈
         */
        @JsonProperty("can_feedback")
        private Boolean canFeedback;
        
        /**
         * 是否可以评分
         */
        @JsonProperty("can_rating")
        private Boolean canRating;
        
        /**
         * 文档信息
         */
        private Object docs;
        
        /**
         * 额外信息
         */
        @JsonProperty("extra_info")
        private Object extraInfo;
        
        /**
         * 文件信息
         */
        @JsonProperty("file_infos")
        private List<Object> fileInfos;
        
        /**
         * 意图分类
         */
        @JsonProperty("intent_category")
        private String intentCategory;
        
        /**
         * 中断信息
         */
        @JsonProperty("interrupt_info")
        private Object interruptInfo;
        
        /**
         * 选项卡片
         */
        @JsonProperty("option_cards")
        private Object optionCards;
        
        /**
         * 引用信息
         */
        @JsonProperty("quote_infos")
        private Object quoteInfos;
        

        /**
         * Token统计信息
         */
        @JsonProperty("token_count")
        private Integer tokenCount;

        /**
         * Token统计信息
         */
        @JsonProperty("token_statistics")
        private TokenStatistics tokenStatistics;
        
        /**
         * 参考来源信息
         */
        private List<Reference> references;
        
        /**
         * 思考过程信息
         */
        private Thought thought;

        
        // Getters and Setters
        public String getContent() {
            return content;
        }
        
        public void setContent(String content) {
            this.content = content;
        }

        public Integer getTokenCount() {
            return tokenCount;
        }

        public void setTokenCount(Integer tokenCount) {
            this.tokenCount = tokenCount;
        }

        public String getFromAvatar() {
            return fromAvatar;
        }
        
        public void setFromAvatar(String fromAvatar) {
            this.fromAvatar = fromAvatar;
        }
        
        public String getFromName() {
            return fromName;
        }
        
        public void setFromName(String fromName) {
            this.fromName = fromName;
        }
        
        public Boolean getIsEvil() {
            return isEvil;
        }
        
        public void setIsEvil(Boolean isEvil) {
            this.isEvil = isEvil;
        }
        
        public Boolean getIsFinal() {
            return isFinal;
        }
        
        public void setIsFinal(Boolean isFinal) {
            this.isFinal = isFinal;
        }
        
        public Boolean getIsFromSelf() {
            return isFromSelf;
        }
        
        public void setIsFromSelf(Boolean isFromSelf) {
            this.isFromSelf = isFromSelf;
        }
        
        public Boolean getIsLlmGenerated() {
            return isLlmGenerated;
        }
        
        public void setIsLlmGenerated(Boolean isLlmGenerated) {
            this.isLlmGenerated = isLlmGenerated;
        }
        
        public List<Knowledge> getKnowledge() {
            return knowledge;
        }
        
        public void setKnowledge(List<Knowledge> knowledge) {
            this.knowledge = knowledge;
        }
        
        public String getRecordId() {
            return recordId;
        }
        
        public void setRecordId(String recordId) {
            this.recordId = recordId;
        }
        
        public String getRelatedRecordId() {
            return relatedRecordId;
        }
        
        public void setRelatedRecordId(String relatedRecordId) {
            this.relatedRecordId = relatedRecordId;
        }
        
        public Integer getReplyMethod() {
            return replyMethod;
        }
        
        public void setReplyMethod(Integer replyMethod) {
            this.replyMethod = replyMethod;
        }
        
        public String getRequestId() {
            return requestId;
        }
        
        public void setRequestId(String requestId) {
            this.requestId = requestId;
        }
        
        public String getSessionId() {
            return sessionId;
        }
        
        public void setSessionId(String sessionId) {
            this.sessionId = sessionId;
        }
        
        public Long getTimestamp() {
            return timestamp;
        }
        
        public void setTimestamp(Long timestamp) {
            this.timestamp = timestamp;
        }
        
        public String getTraceId() {
            return traceId;
        }
        
        public void setTraceId(String traceId) {
            this.traceId = traceId;
        }
        
        public Boolean getCanRating() {
            return canRating;
        }
        
        public void setCanRating(Boolean canRating) {
            this.canRating = canRating;
        }
        
        public Boolean getCanFeedback() {
            return canFeedback;
        }
        
        public void setCanFeedback(Boolean canFeedback) {
            this.canFeedback = canFeedback;
        }
        
        public Object getDocs() {
            return docs;
        }
        
        public void setDocs(Object docs) {
            this.docs = docs;
        }
        
        public Object getExtraInfo() {
            return extraInfo;
        }
        
        public void setExtraInfo(Object extraInfo) {
            this.extraInfo = extraInfo;
        }
        
        public List<Object> getFileInfos() {
            return fileInfos;
        }
        
        public void setFileInfos(List<Object> fileInfos) {
            this.fileInfos = fileInfos;
        }
        
        public String getIntentCategory() {
            return intentCategory;
        }
        
        public void setIntentCategory(String intentCategory) {
            this.intentCategory = intentCategory;
        }
        
        public Object getInterruptInfo() {
            return interruptInfo;
        }
        
        public void setInterruptInfo(Object interruptInfo) {
            this.interruptInfo = interruptInfo;
        }
        
        public Object getOptionCards() {
            return optionCards;
        }
        
        public void setOptionCards(Object optionCards) {
            this.optionCards = optionCards;
        }
        
        public Object getQuoteInfos() {
            return quoteInfos;
        }
        
        public void setQuoteInfos(Object quoteInfos) {
            this.quoteInfos = quoteInfos;
        }
        
        public TokenStatistics getTokenStatistics() {
            return tokenStatistics;
        }
        
        public void setTokenStatistics(TokenStatistics tokenStatistics) {
            this.tokenStatistics = tokenStatistics;
        }
        
        public List<Reference> getReferences() {
            return references;
        }
        
        public void setReferences(List<Reference> references) {
            this.references = references;
        }
        
        public Thought getThought() {
            return thought;
        }
        
        public void setThought(Thought thought) {
            this.thought = thought;
        }
    }
    
    /**
     * 知识库信息内部类
     */
    public static class Knowledge {
        private Long id;
        private Integer type;
        
        public Knowledge() {}
        
        public Knowledge(Long id, Integer type) {
            this.id = id;
            this.type = type;
        }
        
        public Long getId() {
            return id;
        }
        
        public void setId(Long id) {
            this.id = id;
        }
        
        public Integer getType() {
            return type;
        }
        
        public void setType(Integer type) {
            this.type = type;
        }


    }
    
    /**
     * Token统计信息内部类
     */
    public static class TokenStatistics {
        @JsonProperty("input_tokens")
        private Integer inputTokens;
        
        @JsonProperty("output_tokens")
        private Integer outputTokens;
        
        @JsonProperty("total_tokens")
        private Integer totalTokens;
        
        public TokenStatistics() {}
        
        public TokenStatistics(Integer inputTokens, Integer outputTokens, Integer totalTokens) {
            this.inputTokens = inputTokens;
            this.outputTokens = outputTokens;
            this.totalTokens = totalTokens;
        }
        
        public Integer getInputTokens() {
            return inputTokens;
        }
        
        public void setInputTokens(Integer inputTokens) {
            this.inputTokens = inputTokens;
        }
        
        public Integer getOutputTokens() {
            return outputTokens;
        }
        
        public void setOutputTokens(Integer outputTokens) {
            this.outputTokens = outputTokens;
        }
        
        public Integer getTotalTokens() {
            return totalTokens;
        }
        
        public void setTotalTokens(Integer totalTokens) {
            this.totalTokens = totalTokens;
        }
    }
    
    /**
     * 思考过程信息内部类
     */
    public static class Thought {
        private Integer elapsed;
        
        @JsonProperty("is_workflow")
        private Boolean isWorkflow;
        
        private List<Procedure> procedures;
        
        @JsonProperty("record_id")
        private String recordId;
        
        @JsonProperty("request_id")
        private String requestId;
        
        @JsonProperty("session_id")
        private String sessionId;
        
        @JsonProperty("trace_id")
        private String traceId;
        
        @JsonProperty("workflow_name")
        private String workflowName;
        
        public Thought() {}
        
        public Integer getElapsed() {
            return elapsed;
        }
        
        public void setElapsed(Integer elapsed) {
            this.elapsed = elapsed;
        }
        
        public Boolean getIsWorkflow() {
            return isWorkflow;
        }
        
        public void setIsWorkflow(Boolean isWorkflow) {
            this.isWorkflow = isWorkflow;
        }
        
        public List<Procedure> getProcedures() {
            return procedures;
        }
        
        public void setProcedures(List<Procedure> procedures) {
            this.procedures = procedures;
        }
        
        public String getRecordId() {
            return recordId;
        }
        
        public void setRecordId(String recordId) {
            this.recordId = recordId;
        }
        
        public String getRequestId() {
            return requestId;
        }
        
        public void setRequestId(String requestId) {
            this.requestId = requestId;
        }
        
        public String getSessionId() {
            return sessionId;
        }
        
        public void setSessionId(String sessionId) {
            this.sessionId = sessionId;
        }
        
        public String getTraceId() {
            return traceId;
        }
        
        public void setTraceId(String traceId) {
            this.traceId = traceId;
        }
        
        public String getWorkflowName() {
            return workflowName;
        }
        
        public void setWorkflowName(String workflowName) {
            this.workflowName = workflowName;
        }
    }
    
    /**
     * 调用过程信息内部类
     */
    public static class Procedure {
        private Debugging debugging;
        private Integer index;
        private String name;
        private String title;
        private String status;
        private String icon;
        private String switch_;
        private String workflowName;
        
        @JsonProperty("plugin_type")
        private Integer pluginType;
        
        private Integer elapsed;
        
        public Procedure() {}
        
        public Debugging getDebugging() {
            return debugging;
        }
        
        public void setDebugging(Debugging debugging) {
            this.debugging = debugging;
        }
        
        public Integer getIndex() {
            return index;
        }
        
        public void setIndex(Integer index) {
            this.index = index;
        }
        
        public String getName() {
            return name;
        }
        
        public void setName(String name) {
            this.name = name;
        }
        
        public String getTitle() {
            return title;
        }
        
        public void setTitle(String title) {
            this.title = title;
        }
        
        public String getStatus() {
            return status;
        }
        
        public void setStatus(String status) {
            this.status = status;
        }
        
        public String getIcon() {
            return icon;
        }
        
        public void setIcon(String icon) {
            this.icon = icon;
        }
        
        public String getSwitch_() {
            return switch_;
        }
        
        public void setSwitch_(String switch_) {
            this.switch_ = switch_;
        }
        
        public String getWorkflowName() {
            return workflowName;
        }
        
        public void setWorkflowName(String workflowName) {
            this.workflowName = workflowName;
        }
        
        public Integer getPluginType() {
            return pluginType;
        }
        
        public void setPluginType(Integer pluginType) {
            this.pluginType = pluginType;
        }
        
        public Integer getElapsed() {
            return elapsed;
        }
        
        public void setElapsed(Integer elapsed) {
            this.elapsed = elapsed;
        }
    }
    
    /**
     * 调试过程信息内部类
     */
    public static class Debugging {
        private String content;
        
        public Debugging() {}
        
        public Debugging(String content) {
            this.content = content;
        }
        
        public String getContent() {
            return content;
        }
        
        public void setContent(String content) {
            this.content = content;
        }
    }
    

    /**
     * 错误信息内部类
     */
    public static class Error {
        private Integer code;
        private String message;
        
        public Error() {}
        
        public Error(Integer code, String message) {
            this.code = code;
            this.message = message;
        }
        
        public Integer getCode() {
            return code;
        }
        
        public void setCode(Integer code) {
            this.code = code;
        }
        
        public String getMessage() {
            return message;
        }
        
        public void setMessage(String message) {
            this.message = message;
        }
    }
    
    // 构造函数
    public TencentChatResponse() {}
    
    // Getters and Setters
    public String getType() {
        return type;
    }
    
    public void setType(String type) {
        this.type = type;
    }
    
    public String getMessageId() {
        return messageId;
    }
    
    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }
    
    public Payload getPayload() {
        return payload;
    }
    
    public void setPayload(Payload payload) {
        this.payload = payload;
    }
    
    public Error getError() {
        return error;
    }
    
    public void setError(Error error) {
        this.error = error;
    }
}
